export const addRules = {
  name: [
    {
      required: true,
      message: '请输入应用名称',
      trigger: 'blur'
    }
  ],
  appCode: [
    {
      required: true,
      message: '请输入应用编号',
      trigger: 'blur'
    }
  ],
  baseUrl: [
    {
      required: true,
      message: '请输入基础路径',
      trigger: 'blur'
    }
  ],
  order: [
    {
      required: true,
      message: '请输入显示顺序',
      trigger: 'blur'
    }
  ],
  enabled: [
    {
      type: 'number',
      required: true,
      message: '请选择是否可用',
      trigger: 'change'
    }
  ]
};

export const tableColumns = [
  {
    title: '应用名称',
    dataIndex: 'name'
  },
  {
    title: '应用编号',
    dataIndex: 'appCode'
  },
  {
    title: '应用路径',
    dataIndex: 'baseUrl'
  },
  {
    title: '显示顺序',
    dataIndex: 'order'
  },
  {
    title: '是否可用',
    dataIndex: 'enabled',
    customRender: (row) => {
      if (row.record.enabled) {
        return '是'
      } else {
        return '否'
      }
    }
  },
  {
    title: '更新时间',
    dataIndex: 'updateTime',
    width: '160px'
  },
  {
    title: '操作栏',
    dataIndex: 'operation',
    align: 'center',
    slots: {
      customRender: 'operation'
    },
    width: '120px'
  }
]